package com.innjia.sys.service.impl;

import com.innjia.base.utils.HttpClientUtils;
import com.innjia.sys.service.SnsService;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;

import java.util.HashMap;
import java.util.Map;

/**
 * 盈家短信接口
 * <br>
 * 2017-11-16
 *
 * @author zhouxianglh@gmail.com
 */
@Service("snsInnjiaService")
public class SnsInnjiaServiceImpl implements SnsService {
    @Value("${sns.innjia.url}")
    private String url;

    @Value("${sns.innjia.key}")
    private String key;

    @Override
    public void sendMessage(String mobile, String message) {
        Map<String, Object> params = new HashMap<>();
        params.put("projectName", key);
        params.put("smsSendTo", mobile);
        params.put("smsSendMsg", message);
        HttpClientUtils.post(url, params, false);
    }
}
